package com.cuiweiyou.uiautomator20;

import android.support.annotation.Nullable;

import java.io.Serializable;

/**
 *  www.gaohaiyan.com
 */
public class ModelFriend implements Serializable {

    private String dbIndex;  // 数据库中的位置
    private String phone;    // 电话
    private String wxid;     // 微信号
    private String notename; // 备注名
    private String nickname; // 昵称
    private String datetime; // 互为好友时间
    private String type;
    private boolean isOthersideDeleted = false;

    public ModelFriend() {
    }

    /**
     * @param dbIndex  数据库中的位置
     * @param phone    电话
     * @param wxid     微信号
     * @param notename 备注名
     * @param nickname 昵称
     * @param datetime 互为好友时间
     */
    public ModelFriend(String dbIndex, String phone, String wxid, String notename, String nickname, String datetime, String type, boolean isOthersideDeleted) {
        this.dbIndex = dbIndex;
        this.phone = phone;
        this.wxid = wxid;
        this.notename = notename;
        this.nickname = nickname;
        this.datetime = datetime;
        this.type = type;
        this.isOthersideDeleted = isOthersideDeleted;
    }

    public String getDbIndex() {
        return dbIndex;
    }

    public void setDbIndex(String dbIndex) {
        this.dbIndex = dbIndex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getWxid() {
        return wxid;
    }

    public void setWxid(String wxid) {
        this.wxid = wxid;
    }

    public String getNotename() {
        return notename;
    }

    public void setNotename(String notename) {
        this.notename = notename;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getDatetime() {
        return datetime;
    }

    public void setDatetime(String datetime) {
        this.datetime = datetime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isOthersideDeleted() {
        return isOthersideDeleted;
    }

    public void setOthersideDeleted(boolean othersideDeleted) {
        isOthersideDeleted = othersideDeleted;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        ModelFriend tmp = (ModelFriend) obj;

        if (null != this.phone && null != tmp.getPhone()) {
            return this.phone.equals(tmp.getPhone());
        }

        if (null != this.wxid && null != tmp.getWxid()) {
            return this.wxid.equals(tmp.getWxid());
        }

        return super.equals(obj);
    }

    @Override
    public String toString() {
        return "ModelFriend{" +
                "dbIndex='" + dbIndex + '\'' +
                ", phone='" + phone + '\'' +
                ", wxid='" + wxid + '\'' +
                ", notename='" + notename + '\'' +
                ", nickname='" + nickname + '\'' +
                ", datetime='" + datetime + '\'' +
                ", type='" + type + '\'' +
                ", isOthersideDeleted='" + isOthersideDeleted + '\'' +
                '}';
    }
}
